package com.service.scheduling.task;

import com.service.scheduling.service.OrderProductHrComboService;
import com.service.scheduling.service.OrderProductOtherService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
 * <dl>
 * <dt>back-end</dt>
 * <dd>Description:</dd>
 * <dd>Copyright: Copyright (C) 2015</dd>
 * <dd>Company: </dd>
 * <dd>CreateDate: 2019年12月15日</dd>
 * </dl>
 *
 * @author
 */
@Slf4j
@Component
public class OrderCancelTask {

    @Autowired
    private OrderProductOtherService orderProductOtherService;

    @Autowired
    private OrderProductHrComboService orderProductHrComboService;

    @Scheduled(cron = "0 */5 * * * ?")
    public void cancelOverTimeOrder() {
        log.info("cancelOverTimeOrder-start");

//        orderProductOtherService.cancelOrder();
        orderProductHrComboService.cancelOrder();

        log.info("cancelOverTimeOrder-end");
    }


}
